package codegen.builders;

import java.io.BufferedWriter;
import java.io.IOException;

public class CodegenMethod extends CodegenMethodBase {

	private boolean override;
	private boolean inInterface;

	public CodegenMethod(CodegenType parent, String name) {
		super(parent, name);
	}

	public CodegenMethod override(boolean b) {
		this.override = b;
		return this;
	}

	public boolean isOverride() {
		return override;
	}

	public void writeInterface(BufferedWriter fw) throws IOException {
		writeDeclaration(getName(), fw);
		fw.write(";\n");
	}

	public boolean isInInterface() {
		return inInterface;
	}

	public CodegenMethod interfaceMember(boolean isMember) {
		this.inInterface = isMember;
		return this;
	}

	@Override
	public String toString() {
		return getName();
	}

}
